'''
排序很耗时，当新元素插入时，保持序列的排序是很好的
'''
import bisect
import random

SIZE = 7
random.seed(1729)

my_list = []
for i in range(SIZE):
    new_item = random.randrange(SIZE * 2)
    bisect.insort(my_list, new_item)
    print('%2d ->' % new_item, my_list)

if __name__ == '__main__':
    print('done')
